package com.nuedu.corejava.ch10;

import java.util.Stack;

public class StackClass {
	public static void main(String[] args) {
		//Stack 栈结构 ，FILO
		Stack<Computer> stack = new Stack<>();
		
		//压栈
		for(int i = 0; i<10;i++){
		stack.push(new Computer("HP", 5000+i));
		}
		//弹栈
		Computer  computer = null;
		while ((computer = stack.pop())!=null) {
			System.out.println(computer);
			if(stack.isEmpty()) {
				break;
			}
		}
		
	}

}
